package com.ruoyi.special.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.special.mapper.SpecialCostomCountInfoMapper;
import com.ruoyi.special.domain.SpecialCostomCountInfo;
import com.ruoyi.special.service.ISpecialCostomCountInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 机构统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-30
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SpecialCostomCountInfoServiceImpl implements ISpecialCostomCountInfoService 
{
    @Autowired
    private SpecialCostomCountInfoMapper specialCostomCountInfoMapper;

    /**
     * 查询机构统计
     * 
     * @param id 机构统计主键
     * @return 机构统计
     */
    @Override
    public SpecialCostomCountInfo selectSpecialCostomCountInfoById(Long id)
    {
        return specialCostomCountInfoMapper.selectSpecialCostomCountInfoById(id);
    }

    /**
     * 查询机构统计列表
     * 
     * @param specialCostomCountInfo 机构统计
     * @return 机构统计
     */
    @Override
    public List<SpecialCostomCountInfo> selectSpecialCostomCountInfoList(SpecialCostomCountInfo specialCostomCountInfo)
    {
        return specialCostomCountInfoMapper.selectSpecialCostomCountInfoList(specialCostomCountInfo);
    }

    /**
     * 查询机构统计列表
     *
     * @param specialCostomCountInfo 机构统计
     * @return 机构统计
     */
    @Override
    public List<Map<String, Object>> selectSpecialCostomCountInfoListMap(SpecialCostomCountInfo specialCostomCountInfo)
    {
        return specialCostomCountInfoMapper.selectSpecialCostomCountInfoListMap(specialCostomCountInfo);
    }
    @Override
    public Map<String, Object> selectSpecialCostomCountInfoTotaltMap(SpecialCostomCountInfo specialCostomCountInfo)
    {
        return specialCostomCountInfoMapper.selectSpecialCostomCountInfoTotaltMap(specialCostomCountInfo);
    }

    /**
     * 新增机构统计
     * 
     * @param specialCostomCountInfo 机构统计
     * @return 结果
     */
    @Override
    public int insertSpecialCostomCountInfo(SpecialCostomCountInfo specialCostomCountInfo)
    {
        specialCostomCountInfo.setCreateTime(DateUtils.getNowDate());
        return specialCostomCountInfoMapper.insertSpecialCostomCountInfo(specialCostomCountInfo);
    }

    /**
     * 修改机构统计
     * 
     * @param specialCostomCountInfo 机构统计
     * @return 结果
     */
    @Override
    public int updateSpecialCostomCountInfo(SpecialCostomCountInfo specialCostomCountInfo)
    {
        specialCostomCountInfo.setUpdateTime(DateUtils.getNowDate());
        return specialCostomCountInfoMapper.updateSpecialCostomCountInfo(specialCostomCountInfo);
    }

    /**
     * 批量删除机构统计
     * 
     * @param ids 需要删除的机构统计主键
     * @return 结果
     */
    @Override
    public int deleteSpecialCostomCountInfoByIds(String ids)
    {
        return specialCostomCountInfoMapper.deleteSpecialCostomCountInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除机构统计信息
     * 
     * @param id 机构统计主键
     * @return 结果
     */
    @Override
    public int deleteSpecialCostomCountInfoById(Long id)
    {
        return specialCostomCountInfoMapper.deleteSpecialCostomCountInfoById(id);
    }
}
